<template>
  <div>
    {{status}}
  </div>
</template>

<script>
  import global from '../lib/global'
  import axios from 'axios'

  export default {
    data() {
      return {
        status: ''
      }
    },
    mounted() {
      this.$store.commit('set_title', '获取京东订单')

      if (!this.$store.state.admin) {
        this.$router.goback()
        return
      }

      this.status = '获取中'
      axios.post(global.server + 'getJdBill.do', {}).then(result => {
        const obj = result.data
        if(obj.result == 1) {
          this.status = '获取成功'
        } else {
          this.status = '获取失败'
        }
      }, result => {
        this.status = '获取失败'
      })
    }
  }
</script>
